package com.ruoyi.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * wms业务异常 记录错误信息 所有问题 与编号保存在 wms_question 表中
 * @author mwj
 */
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
public final class QuestionException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 问题备注
     */
    private String remark;

    /**
     * 错误提示
     */
    private String message;

    /***
     * 参数 可为null
     */
    private String [] args;

    public QuestionException(Integer code,String message){
        this.code = code;
        this.message = message;
    }
    public QuestionException(Integer code,String message,String...args){
        this.code = code;
        this.message = message;
        this.args= args;
    }


    public QuestionException(Integer code,String message,String remark){
        this.code = code;
        this.message = message;
        this.remark = remark;
    }

    public QuestionException(Integer code,String message,Throwable cause){
        super(cause);
        this.message = message;
        this.code = code;
    }

    public QuestionException(Integer code,String message,String remark,Throwable cause){
        super(cause);
        this.message = message;
        this.code = code;
        this.remark = remark;
    }

}
